<?php
include_once("../configure/admin.config.inc.php");//--> admin global var
include_once("db.inc.php");						//--> db global var
include_once("Operation.php");					//--> Operation
include_once("Merchant.php");					//--> Merchant
require_once("controlHeader.php");				//--> system control header

$objOperate		= new Operation($sessionImpl->getLanguage());		//--> Operation instance
$objMerchant 	= new Merchant(DB_TAG_COUPON, $uid);	//--> Merchant

$arrOperate = $objOperate->arrGetFromGroupIDAndMenuID($gid, $menuid);

if(isset($_GET['id']) && !empty($_GET['id'])){
	$id = $_GET['id'];

	$isReturn = $objMerchant->delete($arrOperate, $id);
	if($isReturn){
		$error_message = 'delete successfully.';
	}else{
		$error_message = 'delete failure.';
	}
}


echo "<script language='javascript'>";
echo "alert(\"$error_message\");";
echo "location.href=\"".$_SERVER['HTTP_REFERER']."\";";
echo "</script>";

//$backurl = $_SERVER['HTTP_REFERER'];
//header("Location: $backurl");
?>
